//引入express组件
const express = require('express');
//创建路由对象
const router = express.Router();

// 获取服务器健康状态
// GET /health
router.get('/', (req, res) => {
  res.json({ 
    code: 200, 
    message: '服务器运行正常',
    data: {
      timestamp: new Date().toISOString(),
      uptime: Math.round(process.uptime()),
      author: require('../package.json').author,
      version: require('../package.json').version
    }
  });
});

module.exports = router;